<template>
  <div v-if="type == 'ref'">
    <span>{{type}}</span>
  </div>
  <div v-else-if="type == 'datetime'">
    <van-field :id="fieldid" v-model="dataval" required clearable :label="fieldtitle" />
  </div>
  <div v-else>
    <span>{{type}}</span>
  </div>
</template>

<script>
import Vue from 'vue'
import { Button, Field, Cell, CellGroup } from 'vant'
import qs from 'qs'

Vue.use(Button).use(Field).use(Cell).use(CellGroup)
export default {
  name: 'jkb-field',
  data () {
    return {
      dataval: this.fieldval
    }
  },
  props: {
    type: String,
    fieldid: String,
    fieldtitle: String,
    fieldval: String
  },
  methods: {

  }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped lang="scss">

</style>
